﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="SearchVolunteerControl.ascx.vb"
    Inherits="WebForm_ManageTrainingRegister_SearchVolunteerControl" %>
<%@ Register Src="../CommonControl/VolunteerQueryControl.ascx" TagName="VolunteerQueryControl"
    TagPrefix="uc1" %>
<%--<script>
Sys.Application.add_load(
 function(sender, eventArgs) {

	$('input[name*="cbCheckAll"],input[name*="cbCheckAll"]').click(function(){
		$('input[name*="CheckBox1"]').attr('checked', this.checked);
	});


});
</script>--%>
<script src="<%=Me.ResolveUrl("~/js/JScript.js") %>" type="text/javascript"></script>

<asp:Panel ID="panel1" runat="server" BackColor="white" BorderWidth="1" Style="cursor: move;"
    Width="600">
    <br />
    <div align="center">
        <asp:Label ID="lblTitle" runat="server" Text="<%$ Resources:Title %>" SkinID="title" Visible="false"></asp:Label>
    </div>
    <br />
    <table align="center">
        <tr>
            <td>
                <table cellpadding="0" cellspacing="0">
                    <tr>
                        <td>
                            <uc1:VolunteerQueryControl ID="VolunteerQueryControl1" runat="server" />
                        </td>
                        <td valign="bottom" rowspan="2">
                            <asp:Button ID="btnQuery" runat="server" Text="<%$ Resources:Query %>" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <table width="100%">
                                <tr>
                                    <td>
                                        <asp:CheckBox ID="chkListNoBasic" runat="server" meta:resourcekey="chkListNoBasic" />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="chkListNoSpecial" runat="server" meta:resourcekey="chkListNoSpecial" />
                                    </td>
                                </tr>
                            </table>
                            <asp:PlaceHolder ID="pl" runat="server" Visible="false">
                                <table width="100%">
                                    <tr>
                                        <td align="right" width="20%">
                                            <asp:Label ID="lblTrainingBHour" runat="server" Text="<%$ Resources:TrainingBHour %>"></asp:Label>
            <%--                                <asp:RangeValidator ID="chk_TrainingBHour" runat="server" ControlToValidate="txtTrainingBHour"
                                                Display="None" ErrorMessage="<%$ Resources:chk_TrainingBHour %>" MaximumValue="999999999"
                                                MinimumValue="1" Type="Integer"></asp:RangeValidator>--%>
                                        </td>
                                        <td width="30%">
                                            <asp:TextBox ID="txtTrainingBHour" runat="server" Visible="false"></asp:TextBox>
                                        </td>
                                        <td align="right" width="20%">
                                            <asp:Label ID="lblTrainingSHour" runat="server" Text="<%$ Resources:TrainingSHour %>"></asp:Label>
                                           <%-- <asp:RangeValidator ID="chk_TrainingSHour" runat="server" ControlToValidate="txtTrainingSHour"
                                                Display="None" ErrorMessage="<%$ Resources:chk_TrainingSHour %>" MaximumValue="999999999"
                                                MinimumValue="1" Type="Integer"></asp:RangeValidator>--%>
                                        </td>
                                        <td width="30%">
                                            <asp:TextBox ID="txtTrainingSHour" runat="server" Visible="false"></asp:TextBox>
                                        </td>
                                    </tr>
                                </table>
                            </asp:PlaceHolder>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <My:MyGridView ID="GridView_Volunteers" runat="server" SkinID="pager" DataKeyNames="VolunteerID"
                    EmptyDataText="<%$ Resources:NoData %>" AllowPaging="True" AllowSorting="True"
                    PageSize="10" AllowHoverEffect="False" AllowHoverSelect="False" MySortDirection="Ascending">
                    <PagerSettings Position="Top" />
                    <Columns>
                        <asp:TemplateField>
                            <itemtemplate>
                                <asp:CheckBox ID="CheckBox1" runat="server" Enabled='<%# Bind("IsEnable") %>' />
                            </itemtemplate>
                            <headertemplate>
                                <input id="cbCheckAll" onclick="Check2(this,'GridView_Volunteers','CheckBox1');"
                                    runat="server" type="checkbox" />
                                    <%--<asp:CheckBox ID="cbCheckAll" runat="server" OnCheckedChanged="cbCheckAll_CheckedChanged"
                                        AutoPostBack="true"></asp:CheckBox>--%>
                                    <asp:Label ID="Label2" runat="server" Text="全選"></asp:Label>
                            </headertemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="VolunteerID" HeaderText="<%$ Resources:VolunteerID %>"
                            SortExpression="VolunteerID" />
                        <asp:BoundField DataField="VolunteerName" HeaderText="<%$ Resources:VolunteerName %>"
                            SortExpression="VolunteerName" />                            
                        <asp:BoundField DataField="TrainingBHour" HeaderText="<%$ Resources:bfTrainingBHour %>"
                            SortExpression="TrainingBHour" />
                        <asp:BoundField DataField="TrainingSHour" HeaderText="<%$ Resources:bfTrainingSHour %>"
                            SortExpression="TrainingSHour" />
                    </Columns>
                </My:MyGridView>
                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
                    TypeName="BLL_ManageTrainingRegister_SearchVolunteerControl" SelectMethod="BLL_Select">
                    <SelectParameters>
                        <asp:Parameter Name="GroupId" Type="String" />
      <%--                  <asp:Parameter Name="Region" Type="String" />
                        <asp:Parameter Name="Region2" Type="String" />--%>
                        <asp:Parameter Name="UOrganizationID" Type="String" />
                        <asp:Parameter Name="VOrganizationID" Type="Int32" />
                        <asp:Parameter Name="VolunteerId" Type="String" />
                        <asp:Parameter Name="VolunteerName" Type="String" />
                        <asp:Parameter Name="TEL" Type="String" />
                        <asp:Parameter Name="TrainingBHour" Type="Int32" />
                        <asp:Parameter Name="TrainingSHour" Type="Int32" />
                    </SelectParameters>
                </asp:ObjectDataSource>
            </td>
        </tr>
        <tr>
            <td align="center">
                <asp:Button ID="btnOK" runat="server" Text="<%$ Resources:OK%>" />
                <asp:Button ID="btnCancel" runat="server" Text="<%$ Resources:Cancel%>" />
            </td>
        </tr>
    </table>
    <br />
</asp:Panel>
<asp:Button ID="btnDummy" runat="server" Style="display: none" SkinID="null" />
<ajaxToolkit:ModalPopupExtender ID="mpSearch" runat="server" TargetControlID="btnDummy"
    PopupControlID="panel1" CancelControlID="btnCancel" PopupDragHandleControlID="panel1" />
